{include file="Public:header" /}
<script type="text/javascript" src="__PUBLIC__/Home/activity/js/jquery-2.1.0.js" ></script>
		<div class="bar bar-nav">
			<h1 class="title">第三方服务</h1>
			<i class="icon icon-left" onclick="window.history.go(-1);"></i>
		</div>
		
		<nav class="bar bar-tab">
			<a class="tab-item active" href="{:U('Index/index')}">
				<span class="icon icon-home"></span>
				<span class="tab-label">首页</span>
			</a>
			<a class="tab-item" onclick="warn()">
				<span class="icon iconfont icon-phone"></span>
				<span class="tab-label">咨询</span>
			</a>
			<!--<a class="tab-item" href="{:U('Serve/hotel_join')}">
				<span class="icon iconfont icon-account"></span>
				<span class="tab-label">我要加入</span>
			</a>-->
		</nav>


		<div class="content">
			<div class="buttons-tab hotel_screen screen" style="margin-top:10px;">
				<a class="button active" href="#tab1">
					酒店
				</a>
				<a class="button" href="{:U('Serve/trafficList')}">
					交通
				</a>
			</div>

			<div class="buttons-tab  screen" style="margin-top:10px;">
				<a class="button js_sx active">
					费用<i class="icon icon-down" style="margin-left:.5rem;"></i>
					<input style="display: none;" name="orderby" value="asc">
				</a>
			</div>

			<div class="tabs" >
				<div class="in_hot_box activity_1 tab hotel_list active" id="tab1">

					<!--{foreach name="data" item="data"}
					<div class="card demo-card-header-pic">
						<a href="hotel.html">
						<div valign="bottom" class="card-header color-white no-border no-padding">
							<img class='card-cover' src="{$data['smallimage']}" alt="">
						</div>
						<div class="card-content">
							<div class="card-content-inner">
								<p class="hot_list_title">{$data['hotel_name']}</p>
								<p class="service color-gray" style="width: 210px;"><i class="iconfont icon-map"></i>{$data['address']}</p>
								<p class="color-gray">
									<span><i class="iconfont icon-phone"></i>{$data['mobile']}</span>
									<span style="position: absolute;top: initial;right: 0;" class="price">{$data['money']}起</span>
								</p>
							</div>
						</div>
						</a>
					</div>
					{/foreach}-->
					<!--<div class="card demo-card-header-pic">
						<a href="hotel.html">
						<div valign="bottom" class="card-header color-white no-border no-padding">
							<img class='card-cover' src="img/raw_1499911304.jpeg" alt="">
						</div>
						<div class="card-content">
							<div class="card-content-inner">
								<p class="hot_list_title">7天链锁酒店</p>
								<p class="service color-gray">如果你无法简洁的表达你的想法，那只说明你还不够了解它。</p>
								<p class="color-gray"><span><i class="iconfont icon-map"></i>天河</span><span><i class="iconfont icon-phone"></i>020-38686868</span><span class="price">328起</span></p>
							</div>
						</div>
						</a>
					</div>
					<div class="card demo-card-header-pic">
						<a href="hotel.html">
						<div valign="bottom" class="card-header color-white no-border no-padding">
							<img class='card-cover' src="img/raw_1499911304.jpeg" alt="">
						</div>
						<div class="card-content">
							<div class="card-content-inner">
								<p class="hot_list_title">7天链锁酒店</p>
								<p class="service color-gray">如果你无法简洁的表达你的想法，那只说明你还不够了解它。</p>
								<p class="color-gray"><span><i class="iconfont icon-map"></i>天河</span><span><i class="iconfont icon-phone"></i>020-38686868</span><span class="price">328起</span></p>
							</div>
						</div>
						</a>
					</div>
					<div class="card demo-card-header-pic">
						<a href="hotel.html">
						<div valign="bottom" class="card-header color-white no-border no-padding">
							<img class='card-cover' src="img/raw_1499911304.jpeg" alt="">
						</div>
						<div class="card-content">
							<div class="card-content-inner">
								<p class="hot_list_title">7天链锁酒店</p>
								<p class="service color-gray">如果你无法简洁的表达你的想法，那只说明你还不够了解它。</p>
								<p class="color-gray"><span><i class="iconfont icon-map"></i>天河</span><span><i class="iconfont icon-phone"></i>020-38686868</span><span class="price">328起</span></p>
							</div>
						</div>
						</a>
					</div>-->
				</div>

				<p class="getmore" onclick="ajax_sourch_submit();" style="display: none" id="load_more"><span class="icon icon-down"></span> 点击加载更多...</p>
				<p class="nomore" id="load_more" style="display: none"> 没有更多数据了！</p>


				<!--<div class="in_hot_box activity_1 tab hotel_list" id="tab2">

					<div class="card demo-card-header-pic">
						<a href="hotel2.html">
						<div valign="bottom" class="card-header color-white no-border no-padding">
							<img class='card-cover' src="img/raw_1499739014.jpeg" alt="">
						</div>
						<div class="card-content">
							<div class="card-content-inner">
								<p class="hot_list_title">安飞士租车服务</p>
								<p class="service color-gray">如果你无法简洁的表达你的想法，那只说明你还不够了解它。</p>
								<p class="color-gray"><span><i class="iconfont icon-map"></i>天河</span><span><i class="iconfont icon-phone"></i>020-38686868</span><span class="price">328起</span></p>
							</div>
						</div>
						</a>
					</div>-->


					<!--<div class="card demo-card-header-pic">
						<a href="hotel2.html">
						<div valign="bottom" class="card-header color-white no-border no-padding">
							<img class='card-cover' src="img/raw_1499739014.jpeg" alt="">
						</div>
						<div class="card-content">
							<div class="card-content-inner">
								<p class="hot_list_title">安飞士租车服务</p>
								<p class="service color-gray">如果你无法简洁的表达你的想法，那只说明你还不够了解它。</p>
								<p class="color-gray"><span><i class="iconfont icon-map"></i>天河</span><span><i class="iconfont icon-phone"></i>020-38686868</span><span class="price">328起</span></p>
							</div>
						</div>
						</a>
					</div>-->

				</div>
			</div>
		</div>

		
		<!--<script type="text/javascript" src="http://g.alicdn.com/sj/lib/jquery/dist/jquery.min.js"></script>-->
		
		<script type='text/javascript' src='http://g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
		<script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>

		<!--城市选择结束-->

		<script src="http://idangero.us/swiper/dist/js/swiper.min.js"></script>
		<script type="text/javascript" src="__PUBLIC__/Home/activity/js/huodon.js" ></script>
		<script>
			var swiper = new Swiper('.swiper-container', {
				pagination: '.swiper-pagination',
				paginationClickable: true
			});
		</script>
	</body>
</html>
<link rel="stylesheet" href="__PUBLIC__/Home/layer_mobile/need/layer.css" />
<script type="text/javascript" src="__PUBLIC__/Home/layer_mobile/layer.js" ></script>
<script>
    jQuery(document).ready(function(){
        //费用排序
        jQuery(".js_sx").click(function(){
            jQuery(this).toggleClass("active");
            var orderby = $("input[name='orderby']").val();
            if(orderby == 'asc')
            {
                $("input[name='orderby']").attr('value','desc');
                $("#tab1").html('');
                p = 1;
                ajax_get_table(1);
            }
            else
            {
                $("input[name='orderby']").attr('value','asc');
                $("#tab1").html('');
                p = 1;
                ajax_get_table(1);
            }
        })
    })
</script>

<script>
    var p = 1;
    var num = 0;
    jQuery(document).ready(function(){
        ajax_get_table(p);
        //获取分页数
        $.ajax({
            type : "POST",
            url:"{:U('Serve/getHotelPageCount')}",
            async : false,
            success: function(data){
                num = data.num;
            }
        });
    });

    // ajax 抓取页面
    function ajax_get_table(page){
        //cur_page = page; //当前页面 保存为全局变量
		var orderby = $("input[name='orderby']").val();
		//alert(orderby);
        $.ajax({
            type : "POST",
            url:"{:U('Serve/ajax_hotel_list')}",
			data: {'p':page,'orderby':orderby},
            success: function(data){
              // alert(data)
                $("#tab1").append(data);
                p ++;
                if(p>=num)
				{
				    $(".nomore").show();
				    $(".getmore").hide();
				}
				else {
                    $(".getmore").show();
                    $(".nomore").hide();
                }
            }
        });
    }

    //点击加载更多
    function ajax_sourch_submit() {
        ajax_get_table(p);
    }

    function warn() {
        layer.open({
            content: '请先选择要咨询的酒店',
            skin: 'msg',
            time: 2 //2秒后自动关闭
        });
    }
</script>